class AlbumController < Base::AlbumBaseController
  layout "album_public"
    
  def index
    @albums=Album.albums_for_public(params[:page])
    @recent_comments=Comment.recent('PHOTO')
    @sidebar_type=:album_list
  end
  
  #相片列表
  def list_photos
    @album=Album.find(params[:id])
    @photos=@album.photos
    @sidebar_type=:photo_list
  end
  
  #添加评论
  def add_commnet
    @sidebar_type=:photo_view
    if simple_captcha_valid?
      @photo=Photo.find(params[:id])
      comment=Comment.new(params[:comment])
      @photo.comments<<comment
      comments_pagination(@photo.id)
    end
  end

end